from google.appengine.ext import db

class User(db.Model):
    #user info
    user_email = db.StringProperty()
    user_id = db.StringProperty()
    
    #date joined !!!
    date_joined = db.DateProperty()
    
    def labels(self):
        return self.user_labels
    
    def receipts(self):
        return self.user_receipts

class Label(db.Model):
    
    #actual label title
    tag = db.TextProperty()
    
    #user's collection of labels
    user = db.ReferenceProperty(User, collection_name="user_labels")

class Receipt(db.Model):
    #dollars and cents. store using text parser
    dollars = db.IntegerProperty()
    cents = db.IntegerProperty()
    
    #date of receipt
    date = db.DateProperty()
    
    #user's collection of receipts
    user = db.ReferenceProperty(User, collection_name="user_receipts")
    
    #labels attached to the receipt
    """I want to do this as a list property and filter      """
    """receipt results by those with the label key in their """
    """labels.ListProperty().                               """
    labels = db.ListProperty(db.Key)